WHERE

The WHERE clause has two purposes:

When WHERE is used to specify record selection criteria, it includes a search condition in order to determine which records (rows of data) are to be retrieved. For example:

SELECT
    MYTABLE.'SALESPERSON',
    MYTABLE.'SALESTOTAL'
FROM
    'MYTABLE' MYTABLE
WHERE
    MYTABLE.'SALESTOTAL' < 10000.00

When WHERE is used to specify how two tables are linked, an SQL join operator sits between the two table names. See SQL join types (ODBC data sources).

The following is an example of the WHERE clause joining two tables:

SELECT
    CUSTOMER.'CUST_ID',
    CUSTOMER.'CUST_NAME',
    ORDERS.'AMOUNT'
FROM
    'CUSTOMER' CUSTOMER,
    'ORDERS' ORDERS
WHERE
    CUSTOMER.'CUST_ID' = ORDERS.'CUST_ID'


Seagate Software IMG Holdings, Inc.
http://www.seagatesoftware.com
Support services:
http://support.seagatesoftware.com